home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3962 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  44 lines

  1. Newsgroups: comp.lang.c
  2. Path: nntp.coast.net!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: Unbuffered character input...
  5. Message-ID: <DM2zCI.379@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <Pine.SGI.3.91.960129190205.27936A-100000@tahiti.cs.unm.edu> <4elf0t$5vd@ixnews2.ix.netcom.com> <4ep3a1$bee@hacgate2.hac.com>
  8. Date: Thu, 1 Feb 1996 05:02:41 GMT
  9.  
  10. In article <4ep3a1$bee@hacgate2.hac.com> collins@thor.tu.hac.com (Ron Collins) writes:
  11. >Kevin Landry (kevgar@ix.netcom.com) wrote:
  12. >: Caleb Haley <chaley@tahiti.cs.unm.edu> wrote:
  13. >
  14. >: >Greetings!
  15. >
  16. >: >Just curious--is there a way to do unbuffered character input in c?
  17. >: >i.e.  getting just one character without waiting for a carriage return 
  18. >: >(enter)...
  19. >
  20. >: I believe there are two commands in C that do this. getch() is
  21. >: unbuffered input without echo and getche() has the echo. Hope this
  22. >: helps.
  23. >
  24. >: -kevgar@ix.netcom.com
  25. >:      "Cry havoc, and let slip
  26. >:              the dogs of war!!"
  27. >
  28. >No, these are not standard C functions.  (What is a "command"?)  These
  29. >functions are only available on DOS compilers as non-standard extensions.
  30. >
  31. >There is no portable way to get unbuffered input, since C can't possibly
  32. >know all about the dozens or hundreds of different terminal types available
  33. >on all the machines made around the world.
  34. >
  35. >For best results (i.e., least evil alternative), check out the "curses"
  36. >library available for your machine.  Most common flavors can be had for
  37. >free from any SimTel mirror.
  38.     Does 'portability' or 'least evil' imply that everything that is
  39.     not ANSI C be routed through a local version of a UNIX library?
  40. -- 
  41. John A. Grant                        jagrant@emr1.emr.ca
  42. Airborne Geophysics
  43. Geological Survey of Canada, Ottawa
  44.